package rate_limit;

import com.google.common.util.concurrent.RateLimiter;

@SuppressWarnings("UnstableApiUsage")
public class GuavaRateLimiterTest {

    public static void main(String[] args) {
        RateLimiter rateLimiter = RateLimiter.create(2);
        System.out.println(rateLimiter.acquire(10));
        System.out.println(rateLimiter.acquire(1));
        System.out.println(rateLimiter.acquire(1));
        System.out.println(rateLimiter.acquire(1));
    }

}
